"use client";

import React from "react";
import { UserRole } from "@/types/auth";
import MarkdownPreview from "./markdown-preview";

interface DocumentViewProps {
  documentId: string | null;
  content: string;
  userRole: UserRole;
}

export function DocumentView({
  documentId,
  content,
  userRole,
}: DocumentViewProps) {
  if (!documentId) {
    return (
      <div className='flex h-full items-center justify-center'>
        <p className='text-lg text-gray-500'>请从侧边栏选择一个文档</p>
      </div>
    );
  }

  return (
    <div className='p-6 max-w-4xl mx-auto'>
      <MarkdownPreview content={content} />
    </div>
  );
}
